const express = require('express')
const app = express()
// 配置解析表单数据的中间件
app.use(express.urlencoded({extended:false}))
// get请求
app.get('/get', (req, res) => {
  const query=req.query
  res.send({
    status:0,
    msg:'GET请求成功',
    data:query
  })
})

// post请求
app.post('/post', (req, res) => {
  const body=req.body
  res.send({
    status:0,
    msg:'post请求成功',
    data:body
  })
})
app.listen(80, () => console.log('Example app listening on http://127.0.0.1'))